package com.wl.gateway;

import com.netflix.zuul.FilterProcessor;
import com.wl.gateway.filter.AccessFilter;
import com.wl.gateway.filter.ErrorFilterProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

@SpringCloudApplication
@EnableZuulProxy
public class GatewayApplication {

	public static void main(String[] args) {
		SpringApplication.run(GatewayApplication.class, args);
		FilterProcessor.setProcessor(new ErrorFilterProcessor());
	}

	@Bean
	AccessFilter accessFilter(){
		return new AccessFilter();
	}
}
